package hang.xipujewelWeb.entity.app;

import hang.xipujewelWeb.entity.IdEntity;
import hang.xipujewelWeb.entity.account.User;

import java.util.Date;

import javax.persistence.CascadeType;
import javax.persistence.Entity;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToOne;
import javax.persistence.Table;

@Entity
@Table(name = "xipu_shopping_cart")
public class ShoppingCart extends IdEntity { //购物车
	private User uesr;
	private Jewel jewel;
	private Ring ring;
	private int status; //0 未提交   1已提交
	private Date addTime;//添加时间

	@OneToOne
	@JoinColumn(name = "RING_ID")
	public Ring getRing() {
		return ring;
	}

	public void setRing(Ring ring) {
		this.ring = ring;
	}

	@OneToOne
	@JoinColumn(name = "JEWEL_ID")
	public Jewel getJewel() {
		return jewel;
	}

	public void setJewel(Jewel jewel) {
		this.jewel = jewel;
	}

	public Date getAddTime() {
		return addTime;
	}

	public void setAddTime(Date addTime) {
		this.addTime = addTime;
	}

	@ManyToOne(cascade = { CascadeType.REFRESH, CascadeType.PERSIST, CascadeType.MERGE })
	@JoinColumn(name = "USER_ID")
	public User getUesr() {
		return uesr;
	}

	public void setUesr(User uesr) {
		this.uesr = uesr;
	}

	public int getStatus() {
		return status;
	}

	public void setStatus(int status) {
		this.status = status;
	}

}
